In a P2P system, two or more personal computers (PCs) or other devices communicate or collaborate over the network and share common resources including central processing units (CPUs), programs and data. In a P2P structure, there is no central peer or central server. Each peer serves as an information consumer, an information provider, and an information medium. In the P2P network, every peer plays the same role, each computer has equal privileges and obligations, and there is no differentiation as between a server and a client in a client/server (C/S) system.
FIG. 1 illustrates a P2P overlay network with a peer-client structure. All peers together form the P2P overlay network. A client is attached to a peer and is only able to publish and receive content. It does not participate in the routing and searching of the P2P overlay network. Client 1 publishes content (key/value) onto the P2P overlay network through a Put command. Peer 1 finds root peer 2 dedicated to storing key/value pairs according to a specific P2P rule, such as a distributed hash table (DHT) algorithm. Peer 2 stores the key/value pair, which records the value corresponding to each key. Normally, a value is the content corresponding to a key. The content may be true content or a source address that provides the content. When client 2 requests the same key, client 2 sends a Get command to the P2P overlay network to search for a value corresponding to the key. Peer 3 finds root peer 2 dedicated to storing key/value pairs according to a specific P2P rule, such as a DHT algorithm. Finally, peer 2 returns the value corresponding to the key (that is, the content published by client 1 or the address of client 1 that provides the content) to client 2.
According to a prior art, a procedure for selecting a service provision entity in a P2P network includes: selecting a peer of low network cost in the local location or local domain as the service provision entity according to the network information reported by the physical network. A procedure for changing the service provision entity includes: after a client is aware of the fault of a service provision entity, the client sets up a connection with and requests the service from a new service provision entity.
During related researches, the inventor finds the following problem in the prior art:
Because the stability of the selected service provision entity is not evaluated in advance, reselection and changing of the service provision entity frequently occur due to the instability of the service provision entity. For real-time services like video on demand (VoD) and Internet Protocol Television (IPTV), or service requesters with specific requirements, a service provision entity selected according to physical network information cannot assure the stability of service provision. Moreover, it takes time to switch to a new service provision entity after the client detects the fault of the selected service provision entity. This means a delay to the client and therefore does not meet the real-time requirement of the client.